let bigTree = {
    id: 0,
    name: '张三-',
    children: [{
        id: 10,
        name: '张三-1',
        children: []
    }, {
        id: 11,
        name: '张三-2',
        children: []
    },{
        id: 12,
        name: '张三-3',
        children: []
    },{
        id: 13,
        name: '张三-4',
        children: [{
            id: 20,
            name: '张三-5',
        },{
            id: 21,
            name: '张三-6',
        }]
    },{
        id: 14,
        name: '张三-12',
        children: [{
            id: 23,
            name: '张三-13',
        },{
            id: 25,
            name: '张三-14',
        }]
    },]
}
function treeToArray(tree,arr=[]){
    arr.push({
        id:tree.id,
        name:tree.name,
        pid:tree.pid>-1?tree.pid:1000
    })
    if(tree.children && tree.children.length>0){
        for(let children of tree.children){
            children.pid = tree.id
            treeToArray(children,arr)
        }
    }
    return arr;
}
let result = treeToArray(bigTree)
console.log(result)